if (szOptIPName) Strncpy(szTemp, szOptIPName, sizeof(szTemp));
else UNLESS(GetUserString(AmiPhonedScreen, AmiPhonedWindow, szTemp, "Add a Relay IP", "Enter the Name of the site to relay to", sizeof(szTemp))) return;
if (strlen(szTemp) < 1) return;
/* must be lower case */
LowerCase(szTemp);
/* ignore any user@'s */
szNewString = strrchr(szTemp,'@');
if (szNewString == NULL) szNewString = szTemp; else szNewString++;
/* translate "localhost" to our actual name--I get problems otherwise :( */
if (strcmp(szNewString,"localhost") == 0)
{
if (gethostname(szTemp,sizeof(szTemp)) < 0) return;
szNewString = szTemp;
}
ConnectRelay(szNewString, nWhich);
/* Update the menus */
ReplaceMenuString(nWhich);
/* Restore original title */
SetWindowTitle(NULL);
}
/* Based on current socket info, replaces the given item in the Relay